<?php
abstract class Validator {
	
	protected $fieldName;
	protected $value;
	protected $errorMessage;

	function __construct($fieldName, $value, $errorMessage) {
		$this->fieldName = $fieldName;
		$this->value = $value;
		$this->errorMessage = $errorMessage;
	}
	
	/**
	 * Executes validation.
	 * @return a ValidationError obj if validation fail, null otherwise
	 */
	abstract public function validate();
}
?>